home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / mxlist.zip / DMX_WIND.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-04  |  2KB  |  77 lines

  1. Unit  DMX_WIND;
  2.  
  3. {$V- }
  4.  
  5. (*
  6.   This unit contains some pretty cheap setup procedures for making windows.
  7.   By "pretty cheap", I mean that this is not meant to be very fancy.
  8.  
  9.   My actual intention is to demonstrate the various uses for the DMX unit.
  10.   I am working from the premise that programmers may already have windowing
  11.   procedures and prefer not to use redundant code.
  12.  
  13.   These procedures allow for one window-layer to be over the current text.
  14.  
  15.  *)
  16.  
  17. interface
  18.  
  19.  
  20. uses   Crt, DMX2;
  21.  
  22.  
  23.        procedure SaveWindow;
  24.        procedure RestoreWindow;
  25.  
  26.  
  27. implementation
  28.  
  29.  
  30. type   screentype  =  array [0..3999] of char;
  31.        screenunit  =  record
  32.                         Scr                 : screentype;
  33.                         x,y,Attr,wmin,wmax  : word;
  34.                       end;
  35.  
  36. var    screencage  :  screenunit;
  37.        ScreenPtr   : ^screentype;
  38.  
  39.  
  40.   { ─────────────────────────────────────────────────────────────────────── }
  41.  
  42.  
  43. procedure SaveWindow;
  44. begin
  45.   With screencage do
  46.     begin
  47.     x    := WhereX;
  48.     y    := WhereY;
  49.     Attr := TextAttr;
  50.     wmin := WindMin;
  51.     wmax := WindMax;
  52.     Move (ScreenPtr^, Scr, sizeof (Scr));  { move video memory }
  53.     end;
  54. end;
  55.  
  56.  
  57. procedure RestoreWindow;
  58. begin
  59.   With screencage do
  60.     begin
  61.     TextAttr := Attr;
  62.     WindMin  := wmin;
  63.     WindMax  := wmax;
  64.     Move (Scr, ScreenPtr^, sizeof (Scr));  { move video memory }
  65.     GotoXY (x,y);
  66.     end;
  67. end;
  68.  
  69.  
  70.   { ─────────────────────────────────────────────────────────────────────── }
  71.  
  72.  
  73. Begin
  74.   ScreenPtr := ptr (VSeg,0);  { VSeg is an internal DMX variable }
  75. End.
  76.  
  77.